package com.lanou3g.ptp.api.web.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lanou3g.ptp.api.resolver.annotation.SsoStudent;
import com.lanou3g.ptp.entity.Student;
import com.lanou3g.ptp.utils.PtpResult;
import com.lanou3g.ptp.utils.PtpResultUtils;
import com.lanou3g.ptp.vo.WxTmplMsg;
import com.lanou3g.ptp.wx.service.WxService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WxTmplMsgController {
    @Reference
    private WxService wxService;

    @PostMapping("/wx/template-message")
    public PtpResult storeCode(@SsoStudent Student student,
                               @RequestBody WxTmplMsg wxTmplMsg) {
        wxService.storeCode(student.getOpenId(), wxTmplMsg.getForm_id());
        System.out.println(wxTmplMsg.getForm_id()+"formid");
        return PtpResultUtils.ok();
    }
}
